home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / uartty12.zip / FIFO1.ASM < prev    next >
Assembly Source File  |  1991-04-23  |  995b  |  51 lines

  1. PAGE    58,132
  2. TITLE    FIFO    3-18-91    [4-23-91]
  3.  
  4. ;Disassembly of FIFO.COM via ASMGEN,
  5. ;slightly tweaked, expanded for COM2..COM4, etc.
  6. ;
  7. ;David Kirschbaum
  8. ;Toad Hall
  9. ;kirsch%maxemail@uunet
  10.  
  11. LF    EQU    0AH
  12. CR    EQU    0DH
  13.  
  14. COM1    EQU    03F8H        ;COM1 base address
  15. COM2    EQU    02F8H        ;COM2 "
  16. COM3    EQU    03E8H        ;COM3 base address (usually)
  17. COM4    EQU    02E8H        ;COM4 base address (usually)
  18.  
  19. UART    EQU    COM2        ;set to yours
  20.  
  21. CSEG    SEGMENT
  22.     ASSUME DS:CSEG, SS:CSEG ,CS:CSEG ,ES:CSEG
  23.     ORG    100H
  24. Fifo    proc    near
  25.  
  26.     MOV    DX,UART + 2        ;COMn UART base address
  27.     MOV    AL,0C1H
  28.     OUT    DX,AL
  29.     XOR    AX,AX            ;clear msb
  30.     IN    AL,DX
  31.     PUSH    AX            ;save the result
  32.     mov    dx,offset is16550    ;assume 16550 UART
  33.     AND    AL,0C0H            ;mask
  34.     CMP    AL,0C0H            ;16550?
  35.     jz    L0141            ;yep
  36.      mov    DX,offset is8250    ;well, then, it must be 8250
  37. L0141:    MOV    AH,9            ;display msg
  38.     INT    21H
  39.     POP    AX
  40.     MOV    AH,4CH            ;terminate, ERRORLEVEL in AL
  41.     INT    21H
  42.  
  43. is16550    DB    ' 16550 UART    $'
  44. is8250    DB    ' 8250 UART     $'
  45.  
  46.  
  47. Fifo    ENDP
  48.  
  49. CSEG    ENDS
  50.     END    Fifo
  51.